﻿using System;
using System.Web;
using System.Web.UI;
using ASPNETVN.PORTAL.Components.Security;

namespace ASPNETVN.PORTAL.Masters
{
    public partial class OFFICE : MasterPage
    {
        public bool ShowTabs = true;

        protected override void OnInit(EventArgs e)
        {
            // Obtain Portal from Current Context
            Components.Configuration.Items.Portal portal = (Components.Configuration.Items.Portal)HttpContext.Current.Items["Portal"];
            
            // Title of web site.
            this.Head.Title = portal.Title;
            
            
            //leftColumn.Visible = portal.ActiveTab.ShowLeftPane;
            //rightColumn.Visible = portal.ActiveTab.ShowRightPane;

            if ((portal.ActiveTab.ShowLeftPane == false && portal.ActiveTab.ShowRightPane == false) || (!string.IsNullOrEmpty(Request.QueryString["aecid"])))
            {
                leftColumn.Attributes.Add("class", "");
                leftColumn.Controls.Add(new LiteralControl(string.Format("<img alt='' src='{0}/Images/Master/{1}/0.gif' />", Global.GetApplicationPath(), Global.GetThemeName())));

                rightColumn.Attributes.Add("class", "");
                rightColumn.Controls.Add(new LiteralControl(string.Format("<img alt='' src='{0}/Images/Master/{1}/1.gif' />", Global.GetApplicationPath(), Global.GetThemeName())));
            }
            else
            {
                leftColumn.Attributes.Add("class", "LeftPane");
                leftColumn.Controls.Add(new LiteralControl(string.Format("<img alt='' src='{0}/Images/Master/{1}/left.jpg' />", Global.GetApplicationPath(), Global.GetThemeName())));

                rightColumn.Attributes.Add("class", "RightPane");
                rightColumn.Controls.Add(new LiteralControl(string.Format("<img alt='' src='{0}/Images/Master/{1}/right.jpg' />", Global.GetApplicationPath(), Global.GetThemeName())));
            }

            base.OnInit(e);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
        }

       
    }
}